home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / subeqn / subeqn.sty < prev    next >
Text File  |  1989-12-20  |  2KB  |  47 lines

  1. %%% File: subeqn.sty
  2. %%% The subequations environment %%%
  3. %
  4. % Within the subequations environment, the only change is that
  5. % equations are labeled differently.  The number stays the same,
  6. % and lower case letters are appended.  For example, if after doing
  7. % three equations, numbered 1, 2, and 3, you start a subequations
  8. % environmment and do three more equations, they will be numbered
  9. % 4a, 4b, and 4c.  After you end the subequations environment, the
  10. % next equation will be numbered 5.
  11. %
  12. % Both text and equations can be put inside the subequations environment.
  13. %
  14. % If you make any improvements, I'd like to hear about them.
  15. %
  16. % Stephen Gildea
  17. % MIT Earth Resources Lab
  18. % Cambridge, Mass. 02139
  19. % mit-erl!gildea
  20. % gildea@erl.mit.edu
  21. %
  22. \newtoks\@stequation
  23.  
  24. \def\subequations{\refstepcounter{equation}%
  25.   \edef\@savedequation{\the\c@equation}%
  26.   \@stequation=\expandafter{\theequation}%   %only want \theequation
  27.   \edef\@savedtheequation{\the\@stequation}% %expanded once
  28.   \edef\oldtheequation{\theequation}%
  29.   \setcounter{equation}{0}%
  30.   \def\theequation{\oldtheequation\alph{equation}}}
  31.  
  32. \def\endsubequations{%
  33.   \setcounter{equation}{\@savedequation}%
  34.   \@stequation=\expandafter{\@savedtheequation}%
  35.   \edef\theequation{\the\@stequation}%
  36.   \global\@ignoretrue}
  37.  
  38. % More from John Hobby
  39. % Fix Plain's \bigl, \Bigl, etc. macros so that they try to scale with
  40. % LaTeX size changes.  This uses the fact that \@setsize sets \ht\strutbox
  41. % to be 70% of the normal unstretched baselineskip.
  42.  
  43. \def\big#1{{\hbox{$\left#1\vcenter to1.428\ht\strutbox{}\right.\n@space$}}}
  44. \def\Big#1{{\hbox{$\left#1\vcenter to2.142\ht\strutbox{}\right.\n@space$}}}
  45. \def\bigg#1{{\hbox{$\left#1\vcenter to2.857\ht\strutbox{}\right.\n@space$}}}
  46. \def\Bigg#1{{\hbox{$\left#1\vcenter to3.571\ht\strutbox{}\right.\n@space$}}}
  47.